package com.yuanlrc.school.service.impl;

import com.yuanlrc.school.entity.DiscussionDB;
import com.yuanlrc.school.mapper.DiscussionMapper;
import com.yuanlrc.school.service.DiscussionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class DiscussionServiceImpl implements DiscussionService {
    @Resource
    private DiscussionMapper discussionMapper;

    @Override
    public List<DiscussionDB> findAllDiscussion(DiscussionDB discussionDB) {
        return discussionMapper.findAllDiscussion(discussionDB);
    }

    @Override
    public int deleteDiscussion(Integer dId) {
        return discussionMapper.deleteDiscussion(dId);
    }

    @Override
    public int addDiscussion(DiscussionDB discussionDB) {
        return discussionMapper.addDiscussion(discussionDB);
    }

    @Override
    public int editDiscussion(DiscussionDB discussionDB) {
        return discussionMapper.editDiscussion(discussionDB);
    }
}
